# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:  Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-libwww
_realname=libwww-perl
pkgver=6.46
pkgrel=0
pkgdesc="Perl module - World Wide Web library"
url="https://metacpan.org/author/MSCHILLI"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl-http-date perl-http-cookies perl-net-http perl-http-daemon
	perl-html-parser perl-file-listing perl-www-robotrules
	perl-http-negotiate perl-uri perl-http-message
	perl-lwp-mediatypes perl-encode-locale perl-try-tiny"
makedepends="perl-dev perl-test-fatal perl-test-requiresinternet"
checkdepends="perl-test-needs perl-test-leaktrace"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/O/OA/OALDERS/libwww-perl-$pkgver.tar.gz"
builddir="$srcdir/$_realname-$pkgver"

prepare() {
	default_prepare

	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
	rm -v t/base/protocols/nntp.t
}


build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

check() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="ff4b77b3287e17f22ebe8364a7645fec99cfc181a96fb62b63b425c01d5e84e369a12a2c9741cb3ecb612514e873cc2c1af432d7a7feb4dc1ed114eb8f8e033f  libwww-perl-6.46.tar.gz"
